package ooday05test;

public class StaticDemo {
    public static void main(String[] args) {
        //
        StaticVar o1=new StaticVar();
        o1.show();
        StaticVar o2=new StaticVar();
        o2.show();
        StaticVar o3=new StaticVar();
        o3.show();
        System.out.println(StaticVar.b);
        System.out.println("---------------");
        //使用静态块语句
        StaticBlock o4=new StaticBlock();
        //加载类时，静态块语句只执行一次，且自动执行
        StaticBlock o5=new StaticBlock();
        //演示静态方法
        int a=StaticMethod.plus(1,3);
        System.out.println(a);
        StaticMethod.test();
        //静态方法常常用类名加点来调用
    }
}
